﻿<!DOCTYPE HTML>
<html lang="zh">
<head>
<title>监视器函数列表 | AutoHotkey v2</title>
<meta name="description" content="This page lists functions for retrieving screen resolution and multi-monitor info." />
<meta name="ahk:equiv-v1" content="commands/SysGet.htm" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<link href="../static/theme.css" rel="stylesheet" type="text/css" />
<script src="../static/content.js" type="text/javascript"></script>
<script type="text/javascript">$(function(){0<=window.navigator.userAgent.toLowerCase().indexOf("ucbrowser")&&CaoNiMaDeUc()})</script>
</head>
<body>

<h1>监视器函数</h1>

<p>用于检索屏幕分辨率和多显示器信息的函数. 点击函数名获取详细信息.</p>
<table class="info">
    <tr>
        <th>函数</th>
        <th abbr="Descr">描述</th>
    </tr>
    <tr>
        <td><a href="MonitorGet.htm">MonitorGet</a></td>
        <td>检查指定的监视器是否存在, 并可选地检索其边界坐标.</td>
    </tr>
    <tr>
        <td><a href="MonitorGetCount.htm">MonitorGetCount</a></td>
        <td>返回监视器的数量.</td>
    </tr>
    <tr>
        <td><a href="MonitorGetName.htm">MonitorGetName</a></td>
        <td>返回指定监视器的操作系统名称.

.</td>
    </tr>
    <tr>
        <td><a href="MonitorGetPrimary.htm">MonitorGetPrimary</a></td>
        <td>返回主监视器的编号.</td>
    </tr>
    <tr>
        <td><a href="MonitorGetWorkArea.htm">MonitorGetWorkArea</a></td>
        <td>检查指定的监视器是否存在, 并可选地检索其工作区域的边界坐标.</td>
    </tr>
</table>

<h2 id="Remarks">备注</h2>
<p>内置变量 <a href="../Variables.htm#Screen">A_ScreenWidth</a> 和 <a href="../Variables.htm#Screen">A_ScreenHeight</a> 包含主监视器的尺寸(以像素为单位).</p>
<p>可以使用 <a href="SysGet.htm">SysGet</a> 检索所有显示监视器的边框. 例如, 它检索虚拟屏幕的宽度和高度:</p>
<pre>MsgBox SysGet(78) " x " SysGet(79)</pre>

<h2 id="Related">相关</h2>
<p><a href="DllCall.htm">DllCall</a>, <a href="Win.htm">窗口函数</a>, <a href="SysGet.htm">SysGet</a></p>

<h2 id="Examples">示例</h2>
<div class="ex" id="ExLoopAll">
<p><a class="ex_number" href="#ExLoopAll"></a> 显示每个监视器的信息.</p>
<pre>MonitorCount := MonitorGetCount()
MonitorPrimary := MonitorGetPrimary()
MsgBox "Monitor Count:`t" MonitorCount "`nPrimary Monitor:`t" MonitorPrimary
Loop MonitorCount
{
    MonitorGet A_Index, &amp;L, &amp;T, &amp;R, &amp;B
    MonitorGetWorkArea A_Index, &amp;WL, &amp;WT, &amp;WR, &amp;WB
    MsgBox
    (
        "Monitor:`t#" A_Index "
        Name:`t" MonitorGetName(A_Index) "
        Left:`t" L " (" WL " work)
        Top:`t" T " (" WT " work)
        Right:`t" R " (" WR " work)
        Bottom:`t" B " (" WB " work)"
    )
}</pre>
</div>

</body>
</html>